cGalerie) { $cURL = $this->URL."Galerie.php"; } elseif ($this->cTable=="texte") { $cURL = $this->URL."TIKL2.php"; } elseif ($this->cTable=="events") { $cURL = $this->URL."TIKevents3.php"; } elseif ($this->cTable=="cron") { $cURL = $this->URL."Cron.php"; } else { die ("No Table"); } $aParams =array(); if ($this->nDomain) $aParams[]="domain=".$this->nDomain; if ($this->nBereich) $aParams[]="bereich=".$this->nBereich; if ($this->nArtikel) $aParams[]="artikel=".$this->nArtikel; if ($this->nEvent) $aParams[]="event=".$this->nEvent; if ($this->cGalerie) $aParams[]="galerie=".$this->cGalerie; if ($this->nUser) $aParams[]="user=".$this->nUser; if ($this->nJahr) $aParams[]="jahr=".$this->nJahr; if ($this->nMonat) $aParams[]="monat=".$this->nMonat; if ($this->cStichwort) $aParams[]="stichwort=".$this->cStichwort; if (isset($this->nSeite)) $aParams[]="_seite=".$this->nSeite; if ($this->nLimit) $aParams[]="limit=".$this->nLimit; if ($this->cOrder) $aParams[]="_order=".$this->cOrder; if ($this->cQueryName) $aParams[]="_QueryName=".$this->cQueryName; if ($this->nTage) $aParams[]="tage=".$this->nTage; if ($this->nStartTage) $aParams[]="startTage=".$this->nStartTage; if ($this->lNewsletter) $aParams[]="newsletter=".$this->lNewsletter; if (isset($this->lThumbs)) $aParams[]="Thumbs=".$this->lThumbs; if ($this->lArchiv) $aParams[]="archiv=".$this->lArchiv; if ($this->lNoTimeLimit) $aParams[]="NoTimeLimit=".$this->lNoTimeLimit; if ($this->lAlles) $aParams[]="alles=".$this->lAlles; if ($this->lNurText) $aParams[]="nurText=".$this->lNurText; if ($this->lIso) $aParams[]="iso=".$this->lIso; if ($this->cBackLink) $aParams[]="BackLink=".$this->cBackLink; if ($this->cBackURL) $aParams[]="BackURL=".$this->cBackURL; // Cron if ($this->cScript) $aParams[]="script=".$this->cScript; if ($this->cAction) $aParams[]="action=".$this->cAction; if ($this->nID) $aParams[]="id=".$this->nID; //print_r($aParams); $cParams= implode("&", $aParams); //echo "$cURL?$cParams"; if (!$cParams) die ("No Params"); if (isset($cDataString)) { $cData=$cDataString; } else { $cData =file_get_contents("$cURL?$cParams"); } //echo "->$cData<-"; if (!$this->cGalerie and !is_numeric (substr($cData, 0,1))) { // Datenbankfehler $this->aPageDigits = array("Error"); if ($cCacheSelf and file_exists($cCacheSelf)) { // use Cachefile include($cCacheSelf); die(""); } else { $cCacheSelf=""; // don't cache the error message $this->aRows = array(array('0','Keine Datenbankverbindung.')); } } elseif ($this->cGalerie) { $aData=explode("|h|",$cData); $this->aRows = array($aData[0]); $this->aMedia=explode("|i|", $aData[1]); // } elseif ($this->cTable=="cron"){ // $aData=explode("|d|",$cData); // $this->aPageDigits=explode(",",$aData[0]); // $this->aRows[0]=$cData[1]; } else { $aData=explode("|d|",$cData); $this->aPageDigits=explode(",",$aData[0]); $this->aRows=explode("|r|",$aData[1]); } //print_r ($this->aRows); } function CheckCron () { $this->cAction = "Check"; $this->cTable = "cron"; $this->GetExternalData(); $aCron = $this->GetFieldArray (0); if ($aCron['ID']!=0) { $key=substr(md5($this->nDomain.$this->cScript),0,16); $cEmails=openssl_decrypt($aCron['Data'],'aes-256-cbc',$key, OPENSSL_RAW_DATA, 'cVyK4qccqkAH9mwZ'); $aEmails=explode("|d|",$cEmails); $aCron['Emails']=$aEmails; } return $aCron; } function DoneCron () { $this->cAction = "Done"; $this->cTable = "cron"; $this->GetExternalData(); //return $this->GetFieldArray (0); } function GetArtikel ($ID) { $this->nArtikel = $ID; $this->GetExternalData(); return $this->GetFieldArray (0); } function GetEvent ($ID) { $this->nEvent = $ID; $this->GetExternalData(); return $this->GetFieldArray (0); } function GetBereich ($ID) { $this->nBereich = $ID; $this->GetExternalData(); return $this->aRows; } function GetQuery ($QueryName) { $this->cQueryName = $QueryName; $this->GetExternalData(); return $this->aRows; } function GetDomain ($ID) { $this->nDomain = $ID; $this->GetExternalData(); return $this->aRows; } function GetGalerie ($galerie) { $this->cGalerie = $galerie; $this->GetExternalData(); $aTexte = $this->GetFieldArray (0); return array("Texte"=>$aTexte,"Bilder"=>$this->aMedia); } function GetFieldArray ($row) { if ($this->aPageDigits[0]=='Error') { $aFields = array('ID'=>0,'Titel'=>$this->aRows[0][1], 'Hauptbild'=>'','Kurztext'=>'','Langtext'=>'','Medien'=>'','Datum'=>'', 'Preis'=>'','Datum'=>'','Ort'=>'','Bereiche'=>'','Beschreibung'=>'', 'Param'=>'','Data'=>''); } elseif (!$this->cGalerie and $this->aPageDigits[0]==0) { $aFields = array('ID'=>0,'Titel'=>'Keine Einträge', 'Hauptbild'=>'','Kurztext'=>'','Langtext'=>'','Medien'=>'','Datum'=>'', 'Preis'=>'','Datum'=>'','Ort'=>'','Bereiche'=>'','Beschreibung'=>'', 'Param'=>'','Data'=>''); } else { if ($this->cTable=="texte") { $keys= array ("ID","Titel","Hauptbild","Kurztext","Langtext","Medien","Datum","Preis"); } elseif ($this->cTable=="events") { $keys= array ("ID","Titel","Hauptbild","Kurztext","Datum","Ort","Langtext","Medien","Bereiche"); } elseif ($this->cGalerie) { $keys= array ("Titel","Beschreibung","Datum"); } elseif ($this->cTable=="cron") { $keys= array ("ID","Param","Data"); } else { die ("No Table"); } $values=explode("|c|",$this->aRows[$row]); $aFields= array_combine($keys, $values); if (isset($aFields['Medien']) and $aFields['Medien']) { $this->aMedia = explode("|m|",$aFields['Medien']); } } return $aFields; } function GetMedia ($GalerieAlsLink=true,$BilderAlsTag=true) { $cBilder=$cDownloads=$cGalerie=""; $aBilder=array(); foreach ($this->aMedia as $Medium) { if (stristr($Medium,"$aBilder,"Downloads"=>$cDownloads, "Galerie"=>$cGalerie); } else { return array ("Bilder"=>$cBilder,"Downloads"=>$cDownloads, "Galerie"=>$cGalerie); } } function GetMediaArray () { $cBilder=$cDownloads=array(); foreach ($this->aMedia as $Medium) { if (stristr($Medium,"$cBilder,"Downloads"=>$cDownloads); } } ?>